package org.kisekiproject.evaluator.errors {

	/**
	 * @author mikael
	 */
	public class ExpressionError extends Error {
		private var _parseString : String;
		private var _index : int;

		/**
		 * Parse error.
		 */
		public function ExpressionError(message:String, parseString:String, index:int) {
			_parseString=parseString;
			_index=index;
			
			var s:String=message+"\n"+_parseString+"\n";

			for (var i:int=0; i<index; i++)
				s+=" ";

			s+="^";

			super(s);
		}

		/**
		 * Get offending string.
		 */
		public function get parseString() : String {
			return _parseString;
		}

		/**
		 * Get index.
		 */
		public function get index() : int {
			return _index;
		}
	}
}
